Skip to content

Introduce session callback, reduce connection allocation overhead #2129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Jul 21, 2021

Benchmark                                                  Mode  Cnt       Score       Error  Units
ReactiveRedisTemplateBenchmark.clientOnly                 thrpt   10   21845,692 ±   828,334  ops/s
ReactiveRedisTemplateBenchmark.clientReactiveConcatMap    thrpt   10   30100,343 ±   975,742  ops/s
ReactiveRedisTemplateBenchmark.clientReactiveFlatMap      thrpt   10  115879,389 ± 13242,159  ops/s
ReactiveRedisTemplateBenchmark.templateReactiveConcatMap  thrpt   10   26251,948 ±  1976,017  ops/s
ReactiveRedisTemplateBenchmark.templateReactiveFlatMap    thrpt   10   83184,567 ±  6757,851  ops/s

Baseline -> Spring Data overhead concatMap ~ 14%, flatMap 38%

Benchmark                                                                  Mode  Cnt       Score       Error  Units
ReactiveRedisTemplateBenchmark.clientOnly                                 thrpt   10   21428,707 ±   298,980  ops/s
ReactiveRedisTemplateBenchmark.clientReactiveConcatMap                    thrpt   10   29572,175 ±  1361,993  ops/s
ReactiveRedisTemplateBenchmark.clientReactiveFlatMap                      thrpt   10  113934,534 ± 11596,009  ops/s
ReactiveRedisTemplateBenchmark.templateReactiveConcatMap                  thrpt   10   25357,874 ±  1533,066  ops/s
ReactiveRedisTemplateBenchmark.templateReactiveFlatMap                    thrpt   10   94296,062 ±  3511,329  ops/s
ReactiveRedisTemplateBenchmark.templateReactiveExecuteInSessionConcatMap  thrpt   10   26102,247 ±  2329,574  ops/s
ReactiveRedisTemplateBenchmark.templateReactiveExecuteInSessionFlatMap    thrpt   10  101181,742 ±  3725,708  ops/s

After changes -> Spring Data overhead concatMap ~ 13%, flatMap 18% (de-optimized 20%)

Benchmark code: https://gist.github.com/mp911de/38166322a80d6f925a9c43a0a61001c0

mp911de added 4 commits July 21, 2021 14:21
…lback interface.

Allows reuse of a bound connection without additional connection acquisiton overhead.
doCreateMono and doCreateFlux now no longer proxy the connection for commands invoked directly from the ReactiveRedisTemplate implementations as proxying isn't necessary for simple command invocation.
Remove exposeConnection from AbstractOperations.execute(…) as it's always set to true simplifying calling code.
@mp911de mp911de requested a review from christophstrobl July 21, 2021 12:25
@mp911de mp911de added this to the 2.5.4 (2021.0.4) milestone Jul 21, 2021
@mp911de mp911de added the type: task A general task label Jul 21, 2021
christophstrobl pushed a commit that referenced this pull request Sep 13, 2021
…lback interface.

Allows reuse of a bound connection without additional connection acquisition overhead.

Closes: #2110
Original Pull Request: #2129
christophstrobl pushed a commit that referenced this pull request Sep 13, 2021
doCreateMono and doCreateFlux now no longer proxy the connection for commands invoked directly from the ReactiveRedisTemplate implementations as proxying isn't necessary for simple command invocation.

Original Pull Request: #2129
christophstrobl pushed a commit that referenced this pull request Sep 13, 2021
Remove exposeConnection from AbstractOperations.execute(…) as it's always set to true simplifying calling code.

Original Pull Request: #2129
christophstrobl added a commit that referenced this pull request Sep 13, 2021
@christophstrobl christophstrobl deleted the issue/2110 branch September 13, 2021 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revisit performance bottlenecks in hot code paths using Lettuce through the reactive Template
2 participants